package org.demo.pattern.observer;

import java.util.Observable;

/**
 * 
 * @author  
 * @date    2011-5-18
 * @file    org.demo.pattern.observer.Person.java
 */
public class Person extends Observable{

	private String name;
	
	public Person(){
		addObserver(new NameObserver());
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
		setChanged();
		notifyObservers(name);
	}
}
